#ifndef BASEWINDOW_H_226ED1A5_7D5A_4EB6_BFF7_A5FD3D7AB611
#define BASEWINDOW_H_226ED1A5_7D5A_4EB6_BFF7_A5FD3D7AB611


enum kShowMode{
	kShowNormal,
	kShowMinized,
	kShowMaximized,
	kShowHided,
};

class BaseWindow{

public:
	class Delegate{
	public:
		virtual void OnWindowCreated(HWND hwnd){};
		virtual bool OnWindowMessage(UINT message, WPARAM wparam, LPARAM lparam, LRESULT& ret){ return false; }
	};

protected:
	HWND		hwnd_;
	kShowMode	init_show_;
	bool		initialized_;
	bool		window_destroyed_;
	RECT		start_rect_;
	unsigned int background_color_;
	Delegate*	delegate_;
	MSG			current_;
public:
	BaseWindow();
	virtual ~BaseWindow();

	HWND GetHandle()const{ return hwnd_; }
	void SetDelegate(Delegate* del){ delegate_ = del; }

	void Show(kShowMode mode);
	bool ShowWindow(int nCmdShow){ return ::ShowWindow(GetHandle(), nCmdShow); }
	void Init(const RECT& bounds, HWND hParent = 0);
	void Close(bool force);


};

#endif